package com.coolbi.onsupai.core.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.coolbi.onsupai.core.dao.AccountFundDao;
import com.coolbi.onsupai.core.entity.AccountFund;
import com.coolbi.onsupai.core.mapper.AccountFundMapper;

public class AccountFundDaoImpl implements AccountFundDao {

	@Autowired
	private AccountFundMapper accountFundMapper;
	public void setAccountFundMapper(AccountFundMapper accountFundMapper) {
		this.accountFundMapper = accountFundMapper;
	}

	@Override
	public AccountFund save(AccountFund obj) {
		accountFundMapper.save(obj);
		return obj;
	}

	@Override
	public int delete(long id) {
		return accountFundMapper.delete(id);
	}

	@Override
	public int update(AccountFund obj) {
		return accountFundMapper.update(obj);
	}

	@Override
	public AccountFund get(long id) {
		return accountFundMapper.get(id);
	}

	@Override
	public List<AccountFund> list() {
		return accountFundMapper.list();
	}

	@Override
	public List<AccountFund> listByPage(int offset, int limit) {
		Map<String, Object> parameter = new HashMap<String, Object>();
		parameter.put("offset", offset);
		parameter.put("limit", limit);
		return accountFundMapper.listByPage(parameter);
	}

	@Override
	public List<AccountFund> find(Map<String, Object> parameter) {
		return accountFundMapper.listByParameter(parameter);
	}

	@Override
	public List<AccountFund> findByPage(Map<String, Object> parameter,
			int offset, int limit) {
		parameter.put("offset", offset);
		parameter.put("limit", limit);
		return accountFundMapper.listByParameterPage(parameter);
	}

	@Override
	public List<AccountFund> search(Map<String, Object> parameter, int offset,
			int limit) {
		parameter.put("offset", offset);
		parameter.put("limit", limit);
		return accountFundMapper.search(parameter);
	}

	@Override
	public int count() {
		return accountFundMapper.count();
	}

	@Override
	public int countByKeyWord(Map<String, Object> parameter) {
		return accountFundMapper.countByKeyWord(parameter);
	}

	@Override
	public int count(Map<String, Object> parameter) {
		return accountFundMapper.countByParameter(parameter);
	}

}
